package com.zyf.commomutil.exception;


import com.zyf.commomutil.result.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler
    @ResponseBody
    public Result error(Exception e)
    {
        e.printStackTrace();
        return Result.fail();
    }

    @ExceptionHandler
    @ResponseBody
    public Result error(YyghException e)
    {
        e.printStackTrace();
        return Result.fail();
    }
}
